package com.android.jump;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public class MainMenu {
	Bitmap mBg = null;
	MenuItem mStartItem = null;
	MenuItem mQuitItem = null;
	MenuItem mHighScoreItem = null;
	
	static int perpare = 0;
	static int start = 1;
	static int quit = 2;
	static int highscore = 3;
	
	private int status = 0;
	int mCommand = 0;
	public MainMenu(Bitmap bg,MenuItem start, MenuItem hs)
	{
		mBg = bg;
		mStartItem = start;
		mStartItem.setPos(60, 200);
		mHighScoreItem = hs;
		mHighScoreItem.setPos(60, 280);
	}
	
	void doDraw (Canvas canvas,int key)
	{
		canvas.drawBitmap(mBg, 0, 0, null);
		mStartItem.doDraw(canvas,key);
		mHighScoreItem.doDraw(canvas, key);
	}
	
	void update(int x,int y)
	{
		if(mStartItem.isClick(x, y)) {
			status = start;
		}
		else if (mHighScoreItem.isClick(x, y)) {
		    status = highscore;
		}
	}
	
	boolean isClickStart() {
	    return status == start;
	}
	
	boolean isClickHighScore() {
	    return status == highscore;
	}
	
	public void restore() {
	    status = perpare;
	}
}
